#! python3
import pyautogui, sys
from system_hotkey import SystemHotkey

print('Press Ctrl-C to quit.Press Control + Shift + alt + c trigger super-click')
isRunning = False
count = 0

def keyHandle(self):
  global isRunning
  isRunning = not isRunning
  if not isRunning:
    print('clicked %s' % (count,))

hk = SystemHotkey()
hk.register(('control', 'shift', 'alt', 'c'), callback=keyHandle)

try:
    while True:
      if isRunning:
        pyautogui.tripleClick(interval=0.001)
        count += 3
        # x, y = pyautogui.position()
        # positionStr = 'X: ' + str(x).rjust(4) + ' Y: ' + str(y).rjust(4)
        # print(positionStr, end='')
        # print('\b' * len(positionStr), end='', flush=True)
except KeyboardInterrupt:
    print('\n')

